<template>
  <div>
    <li v-for="(item,index) in dataList">
      <router-link :to="item.url" class="sidebar-link" @click.native="showToggle(item)" exact>{{item.name}}</router-link>
      <ul class="sidebar-sub-headers"  :class="currentUrl === item.url ? 'active':''" v-show="isStatusShow">
        <a :href="sub.url" class="sidebar-link" v-for="sub in item.subList">{{sub.subName}}</a>
      </ul>
    </li>
  </div>
</template>
<script>
export default {

  props: {
    dataList: {
      type: Array,
      default: []
    },
    isStatusShow:{
    	type:Boolean,
    	default:false
    },
    currentUrl:{
    	type:String,
    	default:''
    }
  },
  data() {
    return {

    }
  },
  methods:{
  	   showToggle(item) {
  	   	this.$emit('showMenu',item)
      //  this.currentUrl = this.$route.fullPath;
      //  console.log(this.currentUrl,item.url)
       
      //  item.isSubShow = !item.isSubShow;
      //     console.log(item.isSubShow)
      // if(this.currentUrl === item.url){
      //   console.log( item.isSubShow )
      //    item.isSubShow = !item.isSubShow;
      // }

    }
  }
}

</script>
